package com.example.topicfromjinzhuan2024national

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.view.Gravity
import androidx.core.view.GravityCompat
import androidx.recyclerview.widget.LinearLayoutManager
import com.example.topicfromjinzhuan2024national.databinding.ActivityHomeBinding

class Home : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        var binding=ActivityHomeBinding.inflate(layoutInflater)
        setContentView(binding.root)

        var homeRecyList = ArrayList<HomeRecyListObject>()
        homeRecyList.add(HomeRecyListObject(R.drawable.start,"红绿灯管理"))
        homeRecyList.add(HomeRecyListObject(R.drawable.book,"车辆违章"))
        homeRecyList.add(HomeRecyListObject(R.drawable.look,"ETC账户"))
        homeRecyList.add(HomeRecyListObject(R.drawable.look,"用户中心"))
        homeRecyList.add(HomeRecyListObject(R.drawable.look,"数据分析"))
        homeRecyList.add(HomeRecyListObject(R.drawable.look,"公交查询"))
        homeRecyList.add(HomeRecyListObject(R.drawable.look,"天气预报"))
        homeRecyList.add(HomeRecyListObject(R.drawable.download,"用户退出"))
        var layout=LinearLayoutManager(this)
        /*layout.orientation=LinearLayoutManager.VERTICAL*/
        binding.homeRecy.layoutManager=layout
        binding.homeRecy.adapter=HomeRecyAdapter(homeRecyList)

        binding.imgMenu.setOnClickListener {
            binding.drawLayout.openDrawer(GravityCompat.START)
        }
    }
}